package com.ck.ckcloud.networkmanagement.core.enums;

import lombok.Getter;

/**
 * 资源类枚举
 */
@Getter
public class ResourceType{

	public static String FIELD_ID ="ID";
	public static String FIELD_NAME ="Name"; //资源类型名称
	
	public static final int TYPE_NETDEVICES = 100; 		//网络设备
	public static final int TYPE_SERVERS = 200; 		//服务器
	public static final int TYPE_APPS = 300; 			//应用
	public static final int TYPE_LINKS = 500; 			//链路
	public static final int TYPE_NETINTERFACES = 600; 	//网络接口
	public static final int TYPE_VIRTUALMACHINE = 201; //虚拟机
	public static final int TYPE_ROUTER = 101; 			//路由器
	public static final int TYPE_SWITH = 102; 			//交换机
	public static final int TYPE_FIREWALL = 105; 			//防火墙

	
	
	public Integer id;
	public String name;
	
	public static String getNameById(Integer id) {
		String resourceName = "";
		if(id!=null) {
			switch(id)
			{
				case TYPE_NETDEVICES: 
					resourceName = "网络设备";
					break;
				case TYPE_SERVERS: 
					resourceName = "服务器";
					break;
				case TYPE_APPS: 
					resourceName = "应用";
					break;
				case TYPE_LINKS: 
					resourceName = "链路";
					break;
				case TYPE_NETINTERFACES: 
					resourceName = "网络接口";
					break;
				case TYPE_VIRTUALMACHINE: 
					resourceName = "虚拟机";
					break;
				case TYPE_ROUTER: 
					resourceName = "路由器";
					break;
				case TYPE_SWITH: 
					resourceName = "交换机";
					break;
				case TYPE_FIREWALL: 
					resourceName = "防火墙";
					break;
				default: 
					resourceName = "其他";
					break;
			}
		}
		return resourceName;
	}	


}
